extends /layouts/main

block append variables
  - let layout_main_class = "main_width-limit"
  - let layout_page_class = "page_inner_padding"
  - let share = true

block sidebar
  include ~engine/sidebar/templates/sidebar

block sidebar-buttons
  if moduleExists('tutorialMap')
    +b("a").map(href="/tutorial/map", data-action="tutorial-map", data-tooltip=t('tutorial.tutorial_map'))

block append head
  !=js("tutorial", {defer: true})

block content

  != content

  +b.lessons-list
    +e('ol').lessons
      if levelMax == 2 && level == 0
        //- top-level folders in 2-level courses
        each article in children
          +e('li')(class="lesson #{article.children ? '_level_1' : ''}")
            +e('a').link(href=article.url) #{article.title}
            if article.children
              +e('ol').lessons
                each subChild in article.children
                  +e('li')(data-section-number=subChild.weight).lesson._level_2
                    +e('a').link(href=subChild.url) #{subChild.title}
      else if levelMax == 2 && level == 1
        //- 1-level folders in 2-level courses
        each article in children
          +e('li')(data-section-number=weight, class="lesson #{article.children ? '_level_1' : ''}")
            +e('a').link(href=article.url) #{article.title}
      else
        //- folders in plain courses
        each article in children
          +e('li').lesson
            +e('a').link(href=article.url) #{article.title}

